<?php
$current_page = "cautiverio";
header("Content-Type: text/html; charset=utf-8");

$jsonurl = "http://nibble.li/twittertido/web/getQueue.php";
$json = file_get_contents($jsonurl, 0, null, null);
$json_output = json_decode($json, true);
$arrays = $json_output['tweets'];
?>
<!DOCTYPE html>
<html class="ui-mobile-rendering">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <meta name="viewport" content="width=device-width, initial-scale=1"> 
        <title>Twittertido - Procastination everywhere!!!</title>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
        <link rel="stylesheet" href="css/glamour.css" />
        <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
        <script src="js/common.js"></script>
        <!--script type="text/javascript">
            $( function() {
                $('body').bind( 'swipeleft', function( e ) {
                    //                    window.location = 'jd.php';
                    $.mobile.changePage("index.php");
                } );
                $('body').bind( 'swiperight', function( e ) {
                    $.mobile.changePage("ornitologos.php");
                } );

            } );
        </script-->
    </head>
    <body>
        <div data-role="page" >
            <?php include_once("header.php"); ?>
            <ul data-role="listview">
                <?php foreach ($arrays as $tweet) { ?>
                <li id="tweet_row_<?php print $tweet['id'] ?>" name="tweet_row_<?php print $tweet['id'] ?>">
                        <a href="#" onclick="show_hide($('#<?php print $tweet['id'] ?>'))" >
                            <img src="https://api.twitter.com/1/users/profile_image?screen_name=<?php print $tweet['user_tweet']; ?>&size=bigger" />
                            <div style="white-space: normal; font-weight: bold;"><?php print $tweet['user_tweet']; ?></div>
                            <div style="white-space: normal; font-size: smaller; font-weight: normal;"><?php print $tweet['tweet']; ?></div>
                        </a>
                        <div id="<?php print $tweet['id'] ?>" class="ui-grid-a" style="text-align: center; display: none">
                            <div class="ui-block-a" onclick="votarPositivo(<?php print $tweet['id']; ?>)">
                                <div data-role="button" data-theme="b">Aprobar</div>
                            </div>
                            <div class="ui-block-b" onclick="votarNegativo(<?php print $tweet['id']; ?>)">
                                <div data-role="button" data-theme="c">Rechazar</div>
                            </div>
                        </div><!-- /grid-a -->
                    </li>
                <?php } ?>
            </ul><!-- /listview -->

            <a href="cautiverio.php" rel="external" data-role="button" style="margin-top: 15px; width: 98%" data-inline="true">Valorar m&aacute;s tweets</a>
            <?php include_once("footer.php"); ?>
        </div><!-- /page -->
    </body>
</html>

